<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Constant/index')}">字典列表</a></li>
			<li><a href="{:U('Constant/add')}">增加常量</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="{:U('Constant/edit_post')}">
			<fieldset>
				<div class="control-group">
					<label class="control-label">上级:</label>
					<div class="controls">
						<select name="parentid">
							<option value="0">作为一级菜单</option>
							{$list}
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">常量名:</label>
					<div class="controls">
						<input type="text" name="pname" value="{$model.pname}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">常量值:</label>
					<div class="controls">
						<input type="text" name="pvalue" value="{$model.pvalue}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">排序:</label>
					<div class="controls">
						<input type="text" name="listorder" value="{$model.listorder}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">备注:</label>
					<div class="controls">
						<textarea name="mark" rows="5" cols="57" style="width: 500px;">{$model.mark}</textarea>
					</div>
				</div>
			</fieldset>
			<div class="form-actions">
				<input type="hidden" name="id" value="{$model.id}" />
				<button type="submit" class="btn btn-primary js-ajax-submit">更新</button>
				<button class="btn js-ajax-close-btn" type="submit">取消</button>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		$(function() {
			$(".js-ajax-close-btn").on('click', function(e) {
				e.preventDefault();
				Wind.use("artDialog", function() {
					art.dialog({
						id : "question",
						icon : "question",
						fixed : true,
						lock : true,
						background : "#CCCCCC",
						opacity : 0,
						content : "您确定需要关闭当前页面嘛？",
						ok : function() {
							setCookie('refersh_time_admin_menu_index', 1);
							window.close();
							return true;
						}
					});
				});
			});
		});
	</script>
</body>
</html>